import Mock from 'mockjs'

export function getMessageList() {
  return {
    code: '000000',
    message: 'success',
    data: Mock.mock({
      total: '@integer(40, 100)',
      'records|10': [
        {
          apiCode: '@id',
          companyId: '@id',
          companyName: '@cword(3, 5)公司',
          createTime: '@now("yyyy-MM-dd HH:mm:ss")',
          isDelete: 0,
          smsTaskTemplateId: '@id',
          smsTemplateId: '@id',
          smsTemplateName: '@cword(3, 5)模板',
          status: '@pick(1, 2)',
          strategyList: '发个短信打个电话-CASTR0000222;',
          templateId: '@id',
          templateName: '@cword(3, 5)模板',
          updateTime: '@now("yyyy-MM-dd HH:mm:ss")',
          number: '@integer',
          shortLink: '@url',
          remark: '@csentence'
        }
      ]
    })
  }
}

export function getMerchants() {
  return Mock.mock({
    code: '000000',
    message: 'success',
    'data|5-19': [
      {
        code: '@id',
        name: '商户00@integer(1,100)',
        'numbers|1-5': [/^1[34578][0-9]\d{8}$/],
        'robots|5-10': ['robot-@integer(1-100)']
      }
    ]
  })
}

export function addTemplate() {
  return {
    code: '000000',
    data: true,
    message: '成功'
  }
}

export function updateTemplate() {
  return {
    code: '000000',
    data: true,
    message: '成功'
  }
}

export function templeteExists() {
  return {
    code: '000000',
    data: true,
    message: '成功'
  }
}

export function changeTemplateStatus() {
  return {
    code: '000000',
    data: true,
    message: '成功'
  }
}

export function getSmsTemplate() {
  return {
    code: '000000',
    data: [
      {
        id: 56,
        smsName: '国都-发送成功短信',
        variables: []
      },
      {
        id: 65,
        smsName: '短信平台-汉云发送成功',
        variables: []
      },
      {
        id: 144,
        smsName: '短信平台-百分带变量发送失败',
        variables: [
          {
            description: '手机号后四位;5648',
            key: 'lastphone',
            remark: '',
            required: '1'
          }
        ]
      },
      {
        id: 155,
        smsName: '短信平台-百分带变量发送成功-勿动',
        variables: [
          {
            description: '姓名;姓名',
            key: 'cusName',
            remark: '',
            required: '1'
          }
        ]
      },
      {
        id: 178,
        smsName: '勿动模板HB',
        variables: []
      },
      {
        id: 183,
        smsName: '测试链接短信0611',
        variables: [
          {
            description: '短信链接最新;https://4w9.cn',
            key: 'link',
            remark: '',
            required: '1'
          }
        ]
      },
      {
        id: 224,
        smsName: 'cusName百分失败',
        variables: [
          {
            description: '姓名;姓名',
            key: 'cusName',
            remark: '',
            required: '1'
          }
        ]
      },
      {
        id: 225,
        smsName: 'lastphone汉云测试',
        variables: [
          {
            description: '手机号后四位;5648',
            key: 'lastphone',
            remark: '',
            required: '1'
          }
        ]
      },
      {
        id: 226,
        smsName: 'repaymentDate变量还款日期',
        variables: [
          {
            description: '还款日期;03-03',
            key: 'repaymentDate',
            remark: '',
            required: '1'
          }
        ]
      },
      {
        id: 228,
        smsName: 'score评分变量',
        variables: [
          {
            description: '评分结果;700.12',
            key: 'score',
            remark: '',
            required: '1'
          },
          {
            description: '评分日期;2021-04-24',
            key: 'scoreDate',
            remark: '',
            required: '1'
          }
        ]
      }
    ],
    message: '成功'
  }
}
